#include"List.h"
void TestList1()
{
	ListNode* plist = ListCreate();

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);

	ListPushFront(plist, 10);
	ListPushFront(plist, 20);

	ListPrint(plist);
}

void TestList2()
{
	ListNode* plist = ListCreate();

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListPrint(plist);

	ListPopBack(plist);
	ListPopBack(plist);
	ListPopBack(plist);
	ListPrint(plist);

	ListPushFront(plist, 10);
	ListPushFront(plist, 20);
	ListPushFront(plist, 30);
	ListPushFront(plist, 40);
	ListPrint(plist);

	ListPopFront(plist);
	ListPopFront(plist);
	ListPopFront(plist);
	ListPrint(plist);
}


void TestList3()
{
	ListNode* plist = ListCreate();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);
	ListNode* cur = ListFind(plist, 3);
	ListInsert(cur, 1);
	ListPrint(plist);


	ListErase(cur);
	ListPrint(plist);


	LTDestroy(plist);
}

int main()
{
	//TestList1();


	//TestList2();


	TestList3();
	return 0;
}